<template>
  <div class="reportFormPage" v-if="show">
    <div class="report-dom">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">{{ this.form.baobmc }}</div>
        <div class="codeText">
          <tr v-for="(item, index) in form.baobbhList">
            {{
              item
            }}
          </tr>
        </div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>记录编号：</span>
          <span class="placeholder">{{ form.jilbh }}</span>
        </div>
      </div>
      <!-- .........................1111111111111111111111111111111......................................................... -->
      <div class="table-border">
        <table height="220px" class="top-table">
          <tbody>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程名称</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcmc }}</span>
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程部位/用途</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcbwyt }}</span>
              </td>
            </tr>
            <tr>
              <td height="50" align="center">样品信息</td>
              <td class="specimen-border" colspan="3">
                <span>样品名称：</span>
                <span :class="{ placeholder: !form.yangpmc }">{{ form.yangpmc }}</span>
                <span>；样品编号：</span>
                <span :class="{ 'placeholder-long': !form.yangpbh }">{{ form.yangpbh }}</span>

                <span>；样品数量：</span>
                <span :class="{ placeholder: !form.yangpsl }">{{ form.yangpsl }}</span>
                <span>；样品状态：</span>
                <span :class="{ placeholder: !form.yangpzt }">{{ form.yangpzt }}</span>
                <span>；来样时间：</span>
                <span :class="{ placeholder: !form.yangpsj }">{{ form.yangpsj }}</span>
              </td>
            </tr>
            <tr>
              <td height="25" align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验检测日期</span>
              </td>
               <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->                                            
 <td width="35%" class="text-center">
      <el-input v-model="form.shiyjcrq" />
</td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验条件</span>
              </td>
              <td v-if="isPdf" width="35%">
                温度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjwd }}</span>
                ℃；湿度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjsd }}</span
                >%RH
              </td>
              <td v-else width="35%">
                温度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjwd" class="height100" style="width: 15%" />
                ℃；湿度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjsd" class="height100" style="width: 15%" />
                %RH
              </td>
            </tr>
            <tr>
              <td height="40" align="center" width="15%">
                <span style="width: 90px; display: inline-block">检测依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.jiancyj }}</span>
                <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark" @dblclick.native="showBsJiancyjView" readonly />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">判定依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.pandyj }}</span>
                <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView" @focus="handleFocus('pandyj')" class="mark" />
              </td>
            </tr>
            <tr class="bottom-border">
              <td height="50" align="center">
                <div>主要仪器设备</div>
                <div>名称及编号</div>
              </td>
              <td colspan="3">
                <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
                <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark" @dblclick.native="showBsInstrumentView" readonly></el-input>
              </td>
            </tr>
          </tbody>
        </table>
        <!-- .................................22222222222222222222222222222222............................................... -->
        <table height="60px" class="middle-table">
          <tbody>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">取样地点</span>
              </td>
              <td width="35%">
                <el-input tabindex="200" v-model="form.quydd" @keydown.native="handleKeyDown($event, 0, 0)" :ref="'0_0'" />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">沥青产地</span>
              </td>
              <td width="35%">
                <el-input tabindex="200" v-model="form.cd" @keydown.native="handleKeyDown($event, 0, 1)" :ref="'0_1'" />
              </td>
            </tr>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">沥青种类</span>
              </td>
              <td width="35%">
                <el-input tabindex="200" v-model="form.liqzl" @keydown.native="handleKeyDown($event, 1, 0)" :ref="'1_0'" />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">沥青标号</span>
              </td>
              <td width="35%">
                <el-input tabindex="200" v-model="form.guigxh" @keydown.native="handleKeyDown($event, 1, 1)" :ref="'1_1'" />
              </td>
            </tr>
          </tbody>
        </table>
        <!-- .................................22222222222222222222222222222222............................................... -->
        <table height="548px" class="middle-table">
          <tbody>
            <tr>
              <td colspan="20">沥青针入度（针入度指数）试验</td>
            </tr>
            <tr>
              <td colspan="1" rowspan="2">试样编号</td>
              <td colspan="1" rowspan="2">试验温度（℃）</td>
              <td colspan="18" rowspan="1">针入度(0.1mm)</td>
            </tr>
            <tr>
              <td colspan="4">第一次测值①</td>
              <td colspan="4">第二次测值①</td>
              <td colspan="4">第三次测值①</td>
              <td colspan="4">针入度</td>
              <td colspan="4">针入度指数</td>
            </tr>
            <tr>
              <td colspan="1">
                <el-input tabindex="200" v-model="form.zrdSybh1" @paste.native="handlePaste($event, 0, 0)" @keydown.native="handleKeyDown($event, 2, 0)" :ref="'2_0'" />
              </td>
              <td colspan="1">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdWd1"
                  @paste.native="handlePaste($event, 0, 1)"
                  @keydown.native="handleKeyDown($event, 2, 1)"
                  :ref="'2_1'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz11"
                  @change="calcZrd1(1, 1)"
                  @paste.native="handlePaste($event, 0, 2)"
                  @keydown.native="handleKeyDown($event, 2, 2)"
                  :ref="'2_2'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz21"
                  @change="calcZrd2(2, 1)"
                  @paste.native="handlePaste($event, 0, 3)"
                  @keydown.native="handleKeyDown($event, 2, 3)"
                  :ref="'2_3'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz31"
                  @change="calcZrd3(3, 1)"
                  @paste.native="handlePaste($event, 0, 4)"
                  @keydown.native="handleKeyDown($event, 2, 4)"
                  :ref="'2_4'"
                />
              </td>
              <td colspan="4">
                {{ form.zrdZrd1 }}
              </td>
              <td colspan="4" rowspan="5">
                {{ form.zrdPjz }}
              </td>
            </tr>
            <tr>
              <td colspan="1">
                <el-input tabindex="200" v-model="form.zrdSybh2" @paste.native="handlePaste($event, 1, 0)" @keydown.native="handleKeyDown($event, 3, 0)" :ref="'3_0'" />
              </td>
              <td colspan="1">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdWd2"
                  @paste.native="handlePaste($event, 1, 1)"
                  @keydown.native="handleKeyDown($event, 3, 1)"
                  :ref="'3_1'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz12"
                  @change="calcZrd1(1, 2)"
                  @paste.native="handlePaste($event, 1, 2)"
                  @keydown.native="handleKeyDown($event, 3, 2)"
                  :ref="'3_2'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz22"
                  @change="calcZrd2(2, 2)"
                  @paste.native="handlePaste($event, 1, 3)"
                  @keydown.native="handleKeyDown($event, 3, 3)"
                  :ref="'3_3'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz32"
                  @change="calcZrd3(3, 2)"
                  @paste.native="handlePaste($event, 1, 4)"
                  @keydown.native="handleKeyDown($event, 3, 4)"
                  :ref="'3_4'"
                />
              </td>
              <td colspan="4">
                {{ form.zrdZrd2 }}
              </td>
            </tr>
            <tr>
              <td colspan="1">
                <el-input tabindex="200" v-model="form.zrdSybh3" @paste.native="handlePaste($event, 2, 0)" @keydown.native="handleKeyDown($event, 4, 0)" :ref="'4_0'" />
              </td>
              <td colspan="1">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdWd3"
                  @paste.native="handlePaste($event, 2, 1)"
                  @keydown.native="handleKeyDown($event, 4, 1)"
                  :ref="'4_1'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz13"
                  @change="calcZrd1(1, 3)"
                  @paste.native="handlePaste($event, 2, 2)"
                  @keydown.native="handleKeyDown($event, 4, 2)"
                  :ref="'4_2'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz23"
                  @change="calcZrd2(2, 3)"
                  @paste.native="handlePaste($event, 2, 3)"
                  @keydown.native="handleKeyDown($event, 4, 3)"
                  :ref="'4_3'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz33"
                  @change="calcZrd3(3, 3)"
                  @paste.native="handlePaste($event, 2, 4)"
                  @keydown.native="handleKeyDown($event, 4, 4)"
                  :ref="'4_4'"
                />
              </td>
              <td colspan="4">
                {{ form.zrdZrd3 }}
              </td>
            </tr>
            <tr>
              <td colspan="1">
                <el-input tabindex="200" v-model="form.zrdSybh4" @paste.native="handlePaste($event, 3, 0)" @keydown.native="handleKeyDown($event, 5, 0)" :ref="'5_0'" />
              </td>
              <td colspan="1">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdWd4"
                  @paste.native="handlePaste($event, 3, 1)"
                  @keydown.native="handleKeyDown($event, 5, 1)"
                  :ref="'5_1'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz14"
                  @change="calcZrd1(1, 4)"
                  @paste.native="handlePaste($event, 3, 2)"
                  @keydown.native="handleKeyDown($event, 5, 2)"
                  :ref="'5_2'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz24"
                  @change="calcZrd2(2, 4)"
                  @paste.native="handlePaste($event, 3, 3)"
                  @keydown.native="handleKeyDown($event, 5, 3)"
                  :ref="'5_3'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz34"
                  @change="calcZrd3(3, 4)"
                  @paste.native="handlePaste($event, 3, 4)"
                  @keydown.native="handleKeyDown($event, 5, 4)"
                  :ref="'5_4'"
                />
              </td>
              <td colspan="4">
                {{ form.zrdZrd4 }}
              </td>
            </tr>
            <tr>
              <td colspan="1">
                <el-input tabindex="200" v-model="form.zrdSybh5" @paste.native="handlePaste($event, 4, 0)" @keydown.native="handleKeyDown($event, 6, 0)" :ref="'6_0'" />
              </td>
              <td colspan="1">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdWd5"
                  @paste.native="handlePaste($event, 4, 1)"
                  @keydown.native="handleKeyDown($event, 6, 1)"
                  :ref="'6_1'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz15"
                  @change="calcZrd1(1, 5)"
                  @paste.native="handlePaste($event, 4, 2)"
                  @keydown.native="handleKeyDown($event, 6, 2)"
                  :ref="'6_2'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz25"
                  @change="calcZrd2(2, 5)"
                  @paste.native="handlePaste($event, 4, 3)"
                  @keydown.native="handleKeyDown($event, 6, 3)"
                  :ref="'6_3'"
                />
              </td>
              <td colspan="4">
                <el-input
                  :type="isPdf ? 'string' : 'number'"
                  tabindex="200"
                  v-model="form.zrdCz35"
                  @change="calcZrd3(3, 5)"
                  @paste.native="handlePaste($event, 4, 4)"
                  @keydown.native="handleKeyDown($event, 6, 4)"
                  :ref="'6_4'"
                />
              </td>
              <td colspan="4">
                {{ form.zrdZrd5 }}
              </td>
            </tr>
            <tr>
              <td colspan="20">沥青延度试验</td>
            </tr>
            <tr>
              <td colspan="1" rowspan="2">试样编号</td>
              <td colspan="1" rowspan="2">试验温度（℃）</td>
              <td colspan="4" rowspan="2">延伸速度（cm/min）</td>
              <td colspan="14" rowspan="1">延度（cm）</td>
            </tr>
            <tr>
              <td colspan="4">试件1测值</td>
              <td colspan="4">试件2测值</td>
              <td colspan="4">试件3测值</td>
              <td colspan="4">平均值</td>
            </tr>
            <tr>
              <td colspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydZybh1" @keydown.native="handleKeyDown($event, 7, 0)" :ref="'7_0'" />
              </td>
              <td colspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydWd1" @keydown.native="handleKeyDown($event, 7, 1)" :ref="'7_1'" />
              </td>
              <td colspan="4">
                <el-input tabindex="200" v-model="form.ydSd1" @keydown.native="handleKeyDown($event, 7, 2)" :ref="'7_2'" />
              </td>
              <td colspan="4">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydCz11" @change="calcYd1(1, 1)" @keydown.native="handleKeyDown($event, 7, 3)" :ref="'7_3'" />
              </td>
              <td colspan="4">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydCz21" @change="calcYd2(2, 1)" @keydown.native="handleKeyDown($event, 7, 4)" :ref="'7_4'" />
              </td>
              <td colspan="4">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydCz31" @change="calcYd3(3, 1)" @keydown.native="handleKeyDown($event, 7, 5)" :ref="'7_5'" />
              </td>
              <td colspan="4">
                {{ form.ydPjz1 }}
              </td>
            </tr>
            <tr>
              <td colspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydZybh2" @keydown.native="handleKeyDown($event, 8, 0)" :ref="'8_0'" />
              </td>
              <td colspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydWd2" @keydown.native="handleKeyDown($event, 8, 1)" :ref="'8_1'" />
              </td>
              <td colspan="4">
                <el-input tabindex="200" v-model="form.ydSd2" @keydown.native="handleKeyDown($event, 8, 2)" :ref="'8_2'" />
              </td>
              <td colspan="4">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydCz12" @change="calcYd1(1, 2)" @keydown.native="handleKeyDown($event, 8, 3)" :ref="'8_3'" />
              </td>
              <td colspan="4">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydCz22" @change="calcYd2(2, 2)" @keydown.native="handleKeyDown($event, 8, 4)" :ref="'8_4'" />
              </td>
              <td colspan="4">
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ydCz32" @change="calcYd3(3, 2)" @keydown.native="handleKeyDown($event, 8, 5)" :ref="'8_5'" />
              </td>
              <td colspan="4">
                {{ form.ydPjz2 }}
              </td>
            </tr>
            <tr>
              <td colspan="20">沥青软化点试验</td>
            </tr>
            <tr>
              <td colspan="1" rowspan="2">试样编号</td>
              <td colspan="1" rowspan="2">烧杯内液体名称</td>
              <td colspan="16" rowspan="1" height="30">烧杯中液体每分钟末温度上升记录（℃）</td>
              <td colspan="2" rowspan="1">软化点（℃）</td>
            </tr>
            <tr>
              <td height="30">开始</td>
              <td v-for="item in 15">{{ item }}</td>
              <td>测值</td>
              <td>平均值</td>
            </tr>
            <tr>
              <td>
                <el-input tabindex="200" v-model="form.rhdSybh1" @keydown.native="handleKeyDown($event, 9, 0)" :ref="'9_0'" />
              </td>
              <td>
                <el-input tabindex="200" v-model="form.rhdMc1" @keydown.native="handleKeyDown($event, 9, 1)" :ref="'9_1'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhdKsjl1" @keydown.native="handleKeyDown($event, 9, 2)" :ref="'9_2'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd1jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 3)" :ref="'9_3'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd2jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 4)" :ref="'9_4'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd3jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 5)" :ref="'9_5'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd4jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 6)" :ref="'9_6'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd5jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 7)" :ref="'9_7'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd6jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 8)" :ref="'9_8'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd7jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 9)" :ref="'9_9'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd8jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 10)" :ref="'9_10'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd9jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 11)" :ref="'9_11'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd10jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 12)" :ref="'9_12'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd11jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 13)" :ref="'9_13'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd12jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 14)" :ref="'9_14'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd13jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 15)" :ref="'9_15'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd14jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 16)" :ref="'9_16'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd15jl1" @change="calcRhd(1)" @keydown.native="handleKeyDown($event, 9, 17)" :ref="'9_17'" />
              </td>
              <td>
                {{ form.rhdCz1 }}
              </td>
              <td rowspan="2">
                {{ form.rhdPjz }}
              </td>
            </tr>
            <tr>
              <td>
                <el-input tabindex="200" v-model="form.rhdSybh2" @keydown.native="handleKeyDown($event, 10, 0)" :ref="'10_0'" />
              </td>
              <td>
                <el-input tabindex="200" v-model="form.rhdMc2" @keydown.native="handleKeyDown($event, 10, 1)" :ref="'10_1'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhdKsjl2" @keydown.native="handleKeyDown($event, 10, 2)" :ref="'10_2'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd1jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 3)" :ref="'10_3'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd2jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 4)" :ref="'10_4'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd3jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 5)" :ref="'10_5'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd4jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 6)" :ref="'10_6'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd5jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 7)" :ref="'10_7'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd6jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 8)" :ref="'10_8'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd7jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 9)" :ref="'10_9'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd8jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 10)" :ref="'10_10'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd9jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 11)" :ref="'10_11'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd10jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 12)" :ref="'10_12'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd11jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 13)" :ref="'10_13'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd12jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 14)" :ref="'10_14'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd13jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 15)" :ref="'10_15'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd14jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 16)" :ref="'10_16'" />
              </td>
              <td>
                <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.rhd15jl2" @change="calcRhd(2)" @keydown.native="handleKeyDown($event, 10, 17)" :ref="'10_17'" />
              </td>
              <td>
                {{ form.rhdCz2 }}
              </td>
            </tr>
          </tbody>
        </table>
        <!-- .....................................................33333333333333333................................................... -->
        <table height="60px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')" />
            </td>
          </tr>
        </table>
      </div>
      <!-- .................................44444444444............................................. -->
      <table height="22px" class="transparent">
        <tbody>
          <tr>
            <td width="10%" align="right">检测：</td>
            <td width="15%" align="left">
              <!-- {{this.form.jiancr}} -->
            </td>
            <td width="10%" align="right">记录：</td>
            <td width="15%" align="left">
              <!-- {{this.form.jilr}} -->
            </td>
            <td width="10%" align="right">复核：</td>
            <td align="left" width="15%">
              <!-- {{this.form.fuhr}} -->
            </td>
            <td width="10%">日期：</td>
            <td align="left" width="15%">
              <div style="display: inline-block; margin-right: 30px">年</div>
              <div style="display: inline-block; margin-right: 30px">月</div>
              <div style="display: inline-block">日</div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
  </div>
</template>

<script>
import decimal from "@/utils/big-decimal";
import Bus from "@/utils/bus";
import { handleFocus, emptyConvert, calculateMeanvalue, precision0p5, handlePaste, handleKeyDown } from "@/views/reportForms/utils";
import { getLqnZrdydrhdjlbdlBsInfo } from "@/api/report_lqn/lqn";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView.vue";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView.vue";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";
import BaQjDetailView from "@/views/sycs/baQjDetail/BaQjDetailView.vue";
import TableLineLogChart from "@/views/reportForms/components/TableLineLogChart.vue";

export default {
  name: "zrdydrhdjlbdl",
  components: {
    BsInstrumentView,
    BsJiancyjView,
    BsJudgeBaseView,
    BaQjDetailView,
    TableLineLogChart
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    },
    printEmpty: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      form: {
        detailList: [],
        baobbhList: []
      },
      show: false
    };
  },

  watch: {
    isPdf(newVal, oldVal) {
      this.form = { ...emptyConvert(this.form, newVal) };
    }
  },
  created() {
    this.init();
  },
  methods: {
    // 根据报表id获取当前报表信息
    init() {
      this.show = false;
      getLqnZrdydrhdjlbdlBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
        this.form = response.data;
        this.setInitialValue();
        if (!this.form.detailList || this.form.detailList.length <= 0) {
          this.getDetailList();
        }
        this.show = true;
        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      });
    },
    // 设置初始值
    setInitialValue() {
      if (this.form) {
        this.form.baobmc = this.form.baobmc || "沥青针入度、延度、软化点试验检测记录表";
        this.form.baobbh = this.form.baobbh || "JGLQ10002,JGLQ10003,JGLQ10004";
        this.$set(this.form, "baobbhList", []);
        this.form.baobbhList = ["JGLQ10002", "JGLQ10003", "JGLQ10004"];
      }
    },
    getDetailList() {
      this.$set(this.form, "detailList", []);
    },
    // 显示检测依据列表
    showBsJiancyjView() {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj(info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
      // Bus.$emit("setKfBgJiancyj", { jiancyj: this.form.jiancyj, jiancyjIds: this.form.jiancyjIds });
    },
    // 显示判定依据列表
    showBsJudgeBaseView() {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge(info) {
       this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },
    // 显示仪器列表
    showBsInstrumentView() {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument(info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
      // Bus.$emit("setKfBgZhuyyqsbmcjbh", { zhuyyqsbmcjbh: this.form.zhuyyqsbmcjbh, shebIds: this.form.shebIds });
    },
    submitForm() {
      return this.form;
    },
    handleFocus(event) {
      handleFocus(event, this.page, this.form[event]);
    },
    // 针入度测值
    calcZrd1(item, type) {
      if (this.form["zrdCz" + item + type] && this.form["zrdCz2" + type] && this.form["zrdCz3" + type]) {
        const a = decimal.add(this.form["zrdCz" + item + type], this.form["zrdCz2" + type]);
        const b = decimal.add(a, this.form["zrdCz3" + type]);
        if (b != 0) {
          const c = decimal.divide(b, 3, 1);
          this.form["zrdZrd" + type] = c;
        } else {
          this.form["zrdZrd" + type] = null;
        }
      } else {
        this.form["zrdZrd" + type] = null;
      }
      this.calcZrdPjz();
    },
    calcZrd2(item, type) {
      if (this.form["zrdCz" + item + type] && this.form["zrdCz1" + type] && this.form["zrdCz3" + type]) {
        const a = decimal.add(this.form["zrdCz" + item + type], this.form["zrdCz1" + type]);
        const b = decimal.add(a, this.form["zrdCz3" + type]);
        if (b != 0) {
          const c = decimal.divide(b, 3, 1);
          this.form["zrdZrd" + type] = c;
        } else {
          this.form["zrdZrd" + type] = null;
        }
      } else {
        this.form["zrdZrd" + type] = null;
      }
      this.calcZrdPjz();
    },
    calcZrd3(item, type) {
      if (this.form["zrdCz" + item + type] && this.form["zrdCz1" + type] && this.form["zrdCz2" + type]) {
        const a = decimal.add(this.form["zrdCz" + item + type], this.form["zrdCz1" + type]);
        const b = decimal.add(a, this.form["zrdCz2" + type]);
        if (b != 0) {
          const c = decimal.divide(b, 3, 1);
          this.form["zrdZrd" + type] = c;
        } else {
          this.form["zrdZrd" + type] = null;
        }
      } else {
        this.form["zrdZrd" + type] = null;
      }
      this.calcZrdPjz();
    },
    calcZrdPjz() {
      let t = 0;
      let v = 0;
      if (this.form.zrdZrd1) {
        t = decimal.add(t, this.form.zrdZrd1);
        v = v + 1;
      }
      if (this.form.zrdZrd2) {
        t = decimal.add(t, this.form.zrdZrd2);
        v = v + 1;
      }
      if (this.form.zrdZrd3) {
        t = decimal.add(t, this.form.zrdZrd3);
        v = v + 1;
      }
      if (this.form.zrdZrd4) {
        t = decimal.add(t, this.form.zrdZrd4);
        v = v + 1;
      }
      if (this.form.zrdZrd5) {
        t = decimal.add(t, this.form.zrdZrd5);
        v = v + 1;
      }
      if (v != 0) {
        const a = decimal.divide(t, v, 0);
        if (a) {
          this.form.zrdPjz = a;
        } else {
          this.form.zrdPjz = null;
        }
      } else {
        this.form.zrdPjz = null;
      }
      this.backBgzFun();
    },
    // 延度测值
    calcYd1(item, type) {
      if (this.form["ydCz" + item + type] && this.form["ydCz2" + type] && this.form["ydCz3" + type]) {
        const a = decimal.add(this.form["ydCz" + item + type], this.form["ydCz2" + type]);
        const b = decimal.add(a, this.form["ydCz3" + type]);
        if (b != 0) {
          const c = decimal.divide(b, 3, 0);
          this.form["ydPjz" + type] = c;
        } else {
          this.form["ydPjz" + type] = null;
        }
      } else {
        this.form["ydPjz" + type] = null;
      }
      this.backBgzFun();
    },
    calcYd2(item, type) {
      if (this.form["ydCz" + item + type] && this.form["ydCz1" + type] && this.form["ydCz3" + type]) {
        const a = decimal.add(this.form["ydCz" + item + type], this.form["ydCz1" + type]);
        const b = decimal.add(a, this.form["ydCz3" + type]);
        if (b != 0) {
          const c = decimal.divide(b, 3, 0);
          this.form["ydPjz" + type] = c;
        } else {
          this.form["ydPjz" + type] = null;
        }
      } else {
        this.form["ydPjz" + type] = null;
      }
      this.backBgzFun();
    },
    calcYd3(item, type) {
      if (this.form["ydCz" + item + type] && this.form["ydCz1" + type] && this.form["ydCz2" + type]) {
        const a = decimal.add(this.form["ydCz" + item + type], this.form["ydCz2" + type]);
        const b = decimal.add(a, this.form["ydCz1" + type]);
        if (b != 0) {
          const c = decimal.divide(b, 3, 1);
          this.form["ydPjz" + type] = c;
        } else {
          this.form["ydPjz" + type] = null;
        }
      } else {
        this.form["ydPjz" + type] = null;
      }
      this.backBgzFun();
    },
    // 软化点测值
    calcRhd(type) {
      this.getRhdcz(type);
      this.calcRhdPjz();
    },
    calcRhdPjz() {
      if (this.form.rhdCz1 && this.form.rhdCz2) {
        const a = decimal.add(this.form.rhdCz1, this.form.rhdCz2);
        if (a != 0) {
          const b = decimal.divide(a, 2, 0);
          this.form.rhdPjz = b;
        } else {
          this.form.rhdPjz = null;
        }
      } else {
        this.form.rhdPjz = null;
      }
      this.backBgzFun();
    },
    // 判断软化点测值
    getRhdcz(type) {
      let res = null;
      if (this.form["rhd1jl" + type]) {
        res = this.form["rhd1jl" + type];
      }
      if (this.form["rhd2jl" + type]) {
        res = this.form["rhd2jl" + type];
      }
      if (this.form["rhd3jl" + type]) {
        res = this.form["rhd3jl" + type];
      }
      if (this.form["rhd4jl" + type]) {
        res = this.form["rhd4jl" + type];
      }
      if (this.form["rhd5jl" + type]) {
        res = this.form["rhd5jl" + type];
      }
      if (this.form["rhd6jl" + type]) {
        res = this.form["rhd6jl" + type];
      }
      if (this.form["rhd7jl" + type]) {
        res = this.form["rhd7jl" + type];
      }
      if (this.form["rhd8jl" + type]) {
        res = this.form["rhd8jl" + type];
      }
      if (this.form["rhd9jl" + type]) {
        res = this.form["rhd9jl" + type];
      }
      if (this.form["rhd10jl" + type]) {
        res = this.form["rhd10jl" + type];
      }
      if (this.form["rhd11jl" + type]) {
        res = this.form["rhd11jl" + type];
      }
      if (this.form["rhd12jl" + type]) {
        res = this.form["rhd12jl" + type];
      }
      if (this.form["rhd13jl" + type]) {
        res = this.form["rhd13jl" + type];
      }
      if (this.form["rhd14jl" + type]) {
        res = this.form["rhd14jl" + type];
      }
      if (this.form["rhd15jl" + type]) {
        res = this.form["rhd15jl" + type];
      }
      this.form["rhdCz" + type] = res;
    },
    // 返回报告引入值
    backBgzFun() {
      Bus.$emit("setLqnBgJiancjg", [
        { key: 192, value: this.form.zrdPjz }, // 针入度指数
        { key: 185, value: this.form["ydPjz" + 1] }, // 延度10
        { key: 186, value: this.form["ydPjz" + 2] }, // 延度13
        { key: 187, value: this.form.rhdPjz } // 软化点
      ]);
    },

    // 粘贴赋值方法
    handlePaste(event, rowIndex, colIndex) {
      const nameAllArr = [
        ["zrdSybh1", "zrdWd1", "zrdCz11", "zrdCz21", "zrdCz31"],
        ["zrdSybh2", "zrdWd2", "zrdCz12", "zrdCz22", "zrdCz32"],
        ["zrdSybh3", "zrdWd3", "zrdCz13", "zrdCz23", "zrdCz33"],
        ["zrdSybh4", "zrdWd4", "zrdCz14", "zrdCz24", "zrdCz34"],
        ["zrdSybh5", "zrdWd5", "zrdCz15", "zrdCz25", "zrdCz35"]
      ];
      const subscriptArr = [
        [0, 1, 2, 3, 4],
        [0, 1, 2, 3, 4],
        [0, 1, 2, 3, 4],
        [0, 1, 2, 3, 4],
        [0, 1, 2, 3, 4]
      ];

      const methodsAllArr = [
        [null, null, "calcZrd1", "calcZrd2", "calcZrd3"],
        [null, null, "calcZrd1", "calcZrd2", "calcZrd3"],
        [null, null, "calcZrd1", "calcZrd2", "calcZrd3"],
        [null, null, "calcZrd1", "calcZrd2", "calcZrd3"],
        [null, null, "calcZrd1", "calcZrd2", "calcZrd3"]
      ];
      const parameterArr = [
        [null, null, "1-1", "2-1", "3-1"],
        [null, null, "1-2", "2-2", "3-2"],
        [null, null, "1-3", "2-3", "3-3"],
        [null, null, "1-4", "2-4", "3-4"],
        [null, null, "1-5", "2-5", "3-5"]
      ];
      const data = handlePaste(event, rowIndex, colIndex, nameAllArr, methodsAllArr, parameterArr, subscriptArr);
      const { cols, nameSetArr, methodsSetArr, parameterSetArr, subscriptSetArr } = data;
      for (let a = 0; a < nameSetArr.length; a++) {
        for (let b = 0; b < nameSetArr[a].length; b++) {
          this.form[nameSetArr[a][b]] = cols[a][b];
        }
      }
      for (let a = 0; a < methodsSetArr.length; a++) {
        for (let b = 0; b < methodsSetArr[a].length; b++) {
          if (methodsSetArr[a][b]) {
            let parameter = parameterSetArr[a][b];
            let parameterArr = parameter ? parameter.split("-") : [];
            if (parameterArr.length >= 2) {
              this.setCalculate(methodsSetArr[a][b], parameterArr[0], parameterArr[1]);
            }
          }
        }
      }
    },

    // 计算方法调用
    setCalculate(name, a, b, c, d, e) {
      this[name](a, b, c, d, e);
    },
    handleKeyDown(event, rowIndex, colIndex) {
      const maxArr = [1, 1, 4, 4, 4, 4, 4, 5, 5, 17, 17];
      const ref = handleKeyDown(event, rowIndex, colIndex, maxArr);
      if (this.$refs[ref]?.length) {
        this.$refs[ref][0].focus();
      } else if (this.$refs[ref]) {
        this.$refs[ref].focus();
      }
    }
  }
};
</script>

<style scoped></style>
